package ru.study.jdbc.orm;

import java.util.*;

public class StudentOrm implements IOrm{
	private static StudentOrm instance;
	
	private StudentOrm() {};
	
	public static synchronized StudentOrm getInstance() {
		if (instance == null) {
			instance = new StudentOrm(); 
		}
		return instance; 
	}
		
	@Override
	public Map<String,Map> getKeyField() {		
		Map <String,Map> map = new LinkedHashMap <String,Map>();
		Map mapfield = new LinkedHashMap();		
		
		map.put("st_student",mapfield);
		mapfield.put("id","student_id");
		return map;
	}

	@Override
	public Map<String,Map> getOrmTable() {
		
		Map <String,Map> map = new LinkedHashMap <String,Map>();
		Map mapfield = new LinkedHashMap();		
		
		map.put("st_student",mapfield);
		mapfield.put("id","student_id");
		mapfield.put("firstName","firstName");
		mapfield.put("middleName","patronymic");
		mapfield.put("lastName","surName");
		
		return map;
	}

}
